package com.homily.com.test0;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class AndroidWhereResultActivity extends AppCompatActivity{
    protected String mnumber;
    protected TextView phonenumber;
    protected TextView locale;

    protected void onCreate( Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        getmnumber();
       phonenumber=findViewById(R.id.textView);
       locale=findViewById(R.id.textView3);
       getLocale();
    }

    public void getmnumber() {
        Intent intent=getIntent();
        Bundle bundle=intent.getExtras();
        mnumber=bundle.getString("number");
    }

    public void getLocale() {
        phonenumber.setText("电话号码："+mnumber);
        if (mnumber.startsWith("17")){
            locale.setText("保定");
        }else if (mnumber.startsWith("15")){
            locale.setText("石家庄");
        }else if (mnumber.startsWith("16")){
            locale.setText("北京");
        }else {
            locale.setText("未知区域");
        }

    }
}
